Obtaining
and Setting Timer Resolution
The following
example calls the timeGetDevCaps
#define TARGET_RESOLUTION 1 // 1-millisecond target resolution
TIMECAPS tc;
UINT
wTimerRes;
if (timeGetDevCaps(&tc, sizeof(TIMECAPS)) !=
TIMERR_NOERROR)
{
// Error;
application can't continue.
}
wTimerRes = min(max(tc.wPeriodMin, TARGET_RESOLUTION),
tc.wPeriodMax);
timeBeginPeriod(wTimerRes);